87ef67e1c45a1d3c7b3654edc143fc95b9bc3a3b,cdap-app-fabric/src/main/java/co/cask/cdap/internal/app/runtime/batch/MapReduceProgramRunner.java,MapReduceProgramRunner,run,#Program#ProgramOptions#,128

Before Change


      // runner, which is probably the yarn user. This may cause permissions issues if the program
      // tries to access cdap data. For example, writing to a FileSet will fail, as the yarn user will
      // be running the job, but the data directory will be owned by cdap.
      if (!MapReduceTaskContextProvider.isLocal(hConf) && !UserGroupInformation.isSecurityEnabled()) {
        String runAs = cConf.get(Constants.CFG_HDFS_USER);
        try {
          UserGroupInformation.createRemoteUser(runAs)
            .doAs(new PrivilegedExceptionAction<ListenableFuture<Service.State>>() {
              @Override
              public ListenableFuture<Service.State> run() throws Exception {
                return mapReduceRuntimeService.start();

After Change


      // runner, which is probably the yarn user. This may cause permissions issues if the program
      // tries to access cdap data. For example, writing to a FileSet will fail, as the yarn user will
      // be running the job, but the data directory will be owned by cdap.
      if (MapReduceTaskContextProvider.isLocal(hConf) || UserGroupInformation.isSecurityEnabled()) {
        mapReduceRuntimeService.start();
      } else {
        ProgramRunners.startAsUser(cConf.get(Constants.CFG_HDFS_USER), mapReduceRuntimeService);